
public class Quene {
	LinkedListNode first, last;
	
	public void enqueue(Object o){
		LinkedListNode n = new LinkedListNode((int)o);

		if(last == null) {
			first = last = n;
		} else {
			last.next = n;
			last = last.next;	//don't forget move first and last itself
		}
	}
	
	public LinkedListNode dequeue(){
		if(first == null) return null;
		
		LinkedListNode n = first;
		first = first.next;
		
		return n;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
